#:kivy 1.0

<SynchroButton>:
    arrow_width: self.width/4.
    reset_width: self.width/3.
    size_hint: (None,None)
    size: (80,32)
    canvas:
        Clear        
        Color:
            rgba: redwine if self.button_down != 'left' else black
        Rectangle:
            source: 'icons/arrow_left.png'
            size: (self.arrow_width,self.height)
            pos: root.pos
        Color:
            rgba: purple if self.button_down != 'center' else black
        Rectangle:
            size: (self.reset_width,self.height)
            pos: (self.center_x-self.width/6., self.y)
        Color:
            rgba: redwine if self.button_down != 'right' else black
        Rectangle:
            source: 'icons/arrow_left.png'            
            size: (-self.arrow_width,self.height)
            pos: (self.right , self.y)
            

<SynchroItem>:
    orientation: 'vertical'
    left_label: _left
    right_label: _right
    att_label: _att_lab
    button: _button
    
    canvas.after:
        Color:
            rgba: redwine
        Line:
            points: [self.x + self.width*0.1,self.y-2,self.right -  self.width*0.1,self.y-2]
    CompactLabel:
        id: _att_lab
        color: black
        bold: True
        valign: 'middle'
        halign: 'center'


    BoxLayout:
        orientation: 'horizontal'
        CompactLabel:
            id: _left
            valign: 'middle'
            halign: 'center'
        SynchroButton:
            id: _button
        CompactLabel:
            id: _right
            valign: 'middle'
            halign: 'center'
    
<SynchroWidget>:
    orientation: 'vertical'

    wine_desc: _wine_desc
    cancel_button: _cancel_button
    next_button: _next_button
    synchro_box: _synchro_box

    CompactLabel:
        id: _wine_desc
        bold: True
        valign: 'middle'
        halign: 'center'

    BoxLayout:
        id: _synchro_box
        orientation: 'vertical'

    BoxLayout:
        LeVinButton:
            text: _("Cancel")
            id: _cancel_button
        LeVinButton:
            text: _("Next")
            id: _next_button
            on_press: root.next_bottle()
## <SynchroPopup>:
##     background: 'icons/redemptybox.png'
##     border: 66,66,66,66
<SynchroPopup>:
    _background_color: white
    _border_color: purple
    
